import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	server: {
	  cors: true, 	// 默认启用并允许任何源
	  open: false, 	// 在服务器启动时自动在浏览器中打开应用程序
	  port: 3000,
	  proxy: {
	    '/api': {
	      target: 'http://localhost:8081/rentalHousing',
	      changeOrigin: true,
	      rewrite: (path) => path.replace(/^\/api/, '')
	    }
	  },
	}
})
